package com.bw.goods_module.home;

import com.bw.common.mvvm.model.BaseRespository;
import com.bw.network_sdk.BaseEntity;
import com.bw.network_sdk.HttpType;
import com.bw.network_sdk.NetWorkFactory;

import java.util.Map;

import io.reactivex.Observable;

public class HomeRepository extends BaseRespository {

    //请求商品列表接口->当前接口请求需要token需要sign
    public Observable<BaseEntity>requestGoods(Map<String,Object>map){
        Observable<HomeEntity>homeEntityObservable =
                NetWorkFactory.factory(HttpType.TOKENSIGN)
                        .create(ApiService.class).requestGoodsList(createBody(map));
        return checkNetWork(homeEntityObservable);
    }
    public Observable<BaseEntity>requestLoadGoods(Map<String,Object>map){
        Observable<HomeLoadEntity>homeEntityObservable =
                NetWorkFactory.factory(HttpType.TOKENSIGN)
                        .create(ApiService.class).requestLoadGoodsList(createBody(map));
        return checkNetWork(homeEntityObservable);
    }
}
